<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>wangEditor demo</title>
</head>
<body>
<div id="div1"></div>
<textarea hidden   id="text1" style="width:100%; height:200px;" name="content"></textarea>
<script type="text/javascript" src="./public/admin/js/wangEditor.min.js"></script>
<link rel="stylesheet" href="./public/admin/css/wangEditor.min.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
    var E = window.wangEditor
    var editor = new E('#div1')
    var $text1 = $('#text1')
    editor.customConfig.onchange = function (html) {
        // 监控变化，同步更新到 textarea
        $text1.val(html)
    }
    editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
    editor.create()
    // 初始化 textarea 的值
    $text1.val(editor.txt.html())
</script>

</body>
</html>